package com.xianniu.ltc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xianniu.ltc.mapper.TRoleMapper;
import com.xianniu.ltc.model.entity.TRoleDTO;
import com.xianniu.ltc.service.TRoleService;
import com.xxl.sso.core.entity.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;

/**
 * @author WangRuiJie
 * @Title: TRoleServiceImpl
 * @Package com.xianniu.ltc.service.impl
 * @Description:
 * @date 2021/8/47:49 下午
 */

@Slf4j
@Service
public class TRoleServiceImpl implements TRoleService {

    @Resource
    private TRoleMapper mapper;
    @Override
    public ReturnT selectRoleList(String name) {
        QueryWrapper<TRoleDTO> wrapper = new QueryWrapper<>();
        if (!name.equals("")){
            wrapper.eq("NAME", name);
        }
        List<TRoleDTO> roleDTOS = mapper.selectList(wrapper);
        return new ReturnT(roleDTOS);
    }
}
